package com.yu8home.asyc.lis;

import cn.hutool.core.thread.ThreadUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class LogListener {

    @Async
    @EventListener
    public void saveLog(LogEvent logEvent) {
        log.info("LogListener.saveLog...{}", logEvent);
        ThreadUtil.sleep(30 * 1000);
        log.info("LogListener.saveLog!!!");
    }

}
